<%@ include file="inc/header.jspf" %>

<script type="text/javascript">
	function del() {
		if (confirm('Are you sure?'))
			location.href = 'delete?categoryID=${category.categoryID}';
	}

	if ('${category.categoryID}' == null) {
		alert('It doesn\'t exist');
		history.go(-1);
	}
</script>

<form:form modelAttribute="category" method="post">
	<fieldset>
		<form:errors path="*" />
	</fieldset>
	<fieldset>
		<form:label path="categoryID"><fmt:message key="ID"/></form:label>
		<form:input path="categoryID" readonly="true"/>
		<form:label path="name"><fmt:message key="category.name"/></form:label>
		<form:input path="name" readonly="true"/>
		<form:label path="priority"><fmt:message key="priority"/></form:label>
		<form:input path="priority" readonly="true"/>
		<form:label path="date"><fmt:message key="category.date"/></form:label>
		<form:input path="date" readonly="true"/>
	</fieldset>
	
	
	<fieldset style="text-align: right;">
		<button type="button" data-theme="b" data-inline="true" data-icon="bars" onclick="location.href = 'search';"><fmt:message key="list"/></button>
		<button type="button" data-theme="b" data-inline="true" data-icon="edit" onclick="location.href = 'modify?categoryID=${category.categoryID}';"><fmt:message key="modify"/></button>
		<button type="button" data-theme="b" data-inline="true" data-icon="delete" onclick="del();"><fmt:message key="delete"/></button>
	</fieldset>
</form:form>

<%@ include file="inc/footer.jspf" %>